﻿@namespace MudBlazor.Internal
@using MudBlazor.Extensions

<div class="@Classname">
    @if (!string.IsNullOrWhiteSpace(Text))
    {
        <MudText Class="mud-input-adornment-text"
                 Color="@Color"
                 tabindex="-1">
            @Text
        </MudText>
    }
    else if (!string.IsNullOrWhiteSpace(Icon))
    {
        @if (AdornmentClick.HasDelegate)
        {
            <MudIconButton Class="mud-input-adornment-icon-button mud-no-activator"
                           Icon="@Icon"
                           OnClick="@AdornmentClick"
                           Edge="@(Placement.ToEdge())"
                           Size="@Size"
                           Color="@Color"
                           aria-label="@AriaLabel"
                           tabindex="-1"
                           @onmousedown:stopPropagation />
        }
        else
        {
            <MudIcon Class="mud-input-adornment-icon"
                     Icon="@Icon"
                     Size="@Size"
                     Color="@Color"
                     aria-label="@AriaLabel"
                     tabindex="-1" />
        }
    }
</div>
